﻿using System;
using System.Data;
using System.Data.Common;
using Liger.Common;
using Liger.Data;

namespace EasyFMS.Model
{

	/// <summary>
	/// 实体类zInvoice
	/// </summary>
	[Serializable]
	public class zInvoice : Entity 
	{ 
		 public zInvoice() 
            : base("zInvoice") 
        { 

        }


		#region Model
		private int _UID;
		private int _BillID;
		private string _InvoiceNo;
		private string _InvoiceTitle;
		private string _Note;
		private int? _UserCreateID;
		private string _CreateDate;
	 
		/// <summary>
		/// 
		/// </summary>
		public int UID
		{
			get{ return _UID; }
			set
			{
				this.OnPropertyValueChange(_.UID,_UID,value);
				this._UID = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public int BillID
		{
			get{ return _BillID; }
			set
			{
				this.OnPropertyValueChange(_.BillID,_BillID,value);
				this._BillID = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public string InvoiceNo
		{
			get{ return _InvoiceNo; }
			set
			{
				this.OnPropertyValueChange(_.InvoiceNo,_InvoiceNo,value);
				this._InvoiceNo = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public string InvoiceTitle
		{
			get{ return _InvoiceTitle; }
			set
			{
				this.OnPropertyValueChange(_.InvoiceTitle,_InvoiceTitle,value);
				this._InvoiceTitle = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public string Note
		{
			get{ return _Note; }
			set
			{
				this.OnPropertyValueChange(_.Note,_Note,value);
				this._Note = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public int? UserCreateID
		{
			get{ return _UserCreateID; }
			set
			{
				this.OnPropertyValueChange(_.UserCreateID,_UserCreateID,value);
				this._UserCreateID = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public string CreateDate
		{
			get{ return _CreateDate; }
			set
			{
				this.OnPropertyValueChange(_.CreateDate,_CreateDate,value);
				this._CreateDate = value;
			}
		}
		#endregion

		#region Method
		/// <summary>
		/// 获取实体中的标识列
		/// </summary>
		public override Field GetIdentityField()
		{
			return _.UID;
		}
		/// <summary>
		/// 获取实体中的主键列
		/// </summary>
		public override Field[] GetPrimaryKeyFields()
		{
			return new Field[] {
				_.UID			};
		}
		/// <summary>
		/// 获取列信息
		/// </summary>
		public override Field[] GetFields()
		{
			return new Field[] {
				_.UID,
				_.BillID,
				_.InvoiceNo,
				_.InvoiceTitle,
				_.Note,
				_.UserCreateID,
				_.CreateDate
			};
		}
		/// <summary>
		/// 获取值信息
		/// </summary>
		public override object[] GetValues()
		{
			return new object[] {
				_UID,
				_BillID,
				_InvoiceNo,
				_InvoiceTitle,
				_Note,
				_UserCreateID,
				_CreateDate
			};
		} 
		/// <summary>
		/// 设置字段值
		/// </summary>
		public override void SetValue(string fieldName, object value)
        {
            switch (fieldName)
            { 
				case "UID":
                    this._UID = DataHelper.ConvertValue<int>(value);
                    break; 
				case "BillID":
                    this._BillID = DataHelper.ConvertValue<int>(value);
                    break; 
				case "InvoiceNo":
                    this._InvoiceNo = DataHelper.ConvertValue<string>(value);
                    break; 
				case "InvoiceTitle":
                    this._InvoiceTitle = DataHelper.ConvertValue<string>(value);
                    break; 
				case "Note":
                    this._Note = DataHelper.ConvertValue<string>(value);
                    break; 
				case "UserCreateID":
                    this._UserCreateID = DataHelper.ConvertValue<int?>(value);
                    break; 
				case "CreateDate":
                    this._CreateDate = DataHelper.ConvertValue<string>(value);
                    break; 
            }
        }
		/// <summary>
		/// 获取字段值
		/// </summary>
        public override object GetValue(string fieldName)
        {
            switch (fieldName)
            { 
				case "UID":
                    return this._UID; 
				case "BillID":
                    return this._BillID; 
				case "InvoiceNo":
                    return this._InvoiceNo; 
				case "InvoiceTitle":
                    return this._InvoiceTitle; 
				case "Note":
                    return this._Note; 
				case "UserCreateID":
                    return this._UserCreateID; 
				case "CreateDate":
                    return this._CreateDate; 
				default :
                    return null;
            } 
        }



		#endregion

		#region _Field
		/// <summary>
		/// 字段信息
		/// </summary>
		public class _
		{
			/// <summary>
			/// * 
			/// </summary>
			public readonly static Field All = new Field("*","zInvoice");
 
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field UID = new Field("UID","zInvoice","UID");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field BillID = new Field("BillID","zInvoice","BillID");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field InvoiceNo = new Field("InvoiceNo","zInvoice","InvoiceNo");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field InvoiceTitle = new Field("InvoiceTitle","zInvoice","InvoiceTitle");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field Note = new Field("Note","zInvoice","Note");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field UserCreateID = new Field("UserCreateID","zInvoice","UserCreateID");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field CreateDate = new Field("CreateDate","zInvoice","CreateDate");
		}
		#endregion

 
	}
}

